this.name                                        = "CMLAP";
this.author                               = "Modified by Lestradae Duval, who hacked it from Thargoid, who had help from Eric Walsh";
this.copyright                                = "Creative Commons: attribution, non-commercial, sharealike.";
this.description                                = "Script for Chain Missile Launcher Ammunition Packs";
this.version                                = "0.1";

this.rackRefresh = function()
        {
        if (0 < oolite.compareVersion("1.72"))
                {
                // 1.71.x or earlier
                this.thePlayerShip = player;
                }
        else
                {
                // 1.72 or later
                this.thePlayerShip = player.ship;
                }
        this.launchRack = this.ship.scriptInfo.launchingRack;
        switch(this.launchRack)
                {
                case "EQ_CMLAP_0_MISSILE":
                        {
                        player.consoleMessage("Chain Missile Launcher Ammunition Pack - ejecting.",6);
                        this.thePlayerShip.spawnOne("CMLAP_spentRack");
                        break;
                        }
                default:
                        {
                        this.thePlayerShip.awardEquipment(this.launchRack);
                        break;
                        }
                }
        }